feat: use accounts v3 for OAuth token requests - #2276
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAuthentication now uses OAuth token V3 endpoints for device flow. UAT token refresh requests now use URL-encoded form data instead of JSON. Tests validate both protocol changes. ChangesOAuth endpoint migration
UAT refresh request encoding
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@50e03702b79a7711dcb871ff1eeff210ac99c199🧩 Skill updatenpx skills add larksuite/cli#feat/unified-token-endpoint -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2276 +/- ##
=======================================
Coverage 76.44% 76.44%
=======================================
Files 1013 1013
Lines 111932 111925 -7
=======================================
- Hits 85561 85560 -1
+ Misses 19860 19855 -5
+ Partials 6511 6510 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
OAuth user-token flows still used the legacy Open Platform token endpoint for device-code polling and refresh. This PR routes those requests to the brand-specific Accounts v3 token endpoint and encodes refresh requests as form data, aligning token acquisition with the unified OAuth endpoint contract.
Changes
ResolveOAuthEndpointsininternal/auth/device_flow.goto use the Feishu or Lark Accounts origin with/oauth/v3/tokeninternal/auth/uat_client.goasapplication/x-www-form-urlencodedPathOAuthTokenV2constantTest Plan
make unit-testpassedgo test ./internal/auth ./internal/core ./internal/credential ./internal/cmdutilgit diff --check origin/main...HEADRelated Issues
N/A
Summary by CodeRabbit